
set(INTERFACE "interface")
set(INTERNAL_INTERFACE "internal_interface")
set(IMPLEMENTATION "implementation")


add_library(Core SHARED
${INTERNAL_INTERFACE}/Core_Hello_interface.cc
${IMPLEMENTATION}/Core_Hello_implement.cc
${INTERFACE}/Core_Interface.cc
)

# 别名
# add_library(hello::library ALIAS Core)

SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ../Bin)

target_include_directories(Core
          INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
          
          )


install(TARGETS Core DESTINATION lib)

SET_TARGET_PROPERTIES(Core PROPERTIES LINKER_LANGUAGE C
        RUNTIME_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
        LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
        OUTPUT_NAME "Core"
        PREFIX "")

set(publih_lib_include "${PROJECT_BINARY_DIR}/gcm.cache")

add_custom_command(TARGET Core
  PRE_LINK  
  #COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/Base/gcm.cache/ ${publih_lib_include}
  #COMMAND ${CMAKE_COMMAND} -E make_directory ${publih_lib_include}
  COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/Core/gcm.cache/Core.gcm ${publih_lib_include}
)
